package cc.admin.modules.sys.service.impl;

import cc.admin.common.sys.vo.LoginUser;
import cc.admin.modules.sys.entity.SysLicence;
import cc.admin.modules.sys.mapper.SysLicenceMapper;
import cc.admin.modules.sys.service.ISysLicenceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 许可管理
 * Sys licence service
 *
 * @author 赵森涛
 * @date 2023.02.16 09:00:33
 * @description description
 */
@Service
public class SysLicenceServiceImpl extends ServiceImpl<SysLicenceMapper, SysLicence> implements ISysLicenceService {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<Map<String, Object>> getShip(){
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        List<Map<String, Object>> dataList = jdbcTemplate.queryForList("select id as value,ship_name as label from sys_ship where tenant_id=?", sysUser.getTenantId());
        return dataList;
    }



}
